import { clearRequestTask } from "@/chronicDisease/request/requestCancel.js";
import config from '@/config'
let baseUrl = config.baseUrl + '/applet'
console.log('慢病', baseUrl);
const chronic = {
    state: {
        baseUrl: baseUrl,
        imageUrl: config.imageUrl,
        // baseUrl:'http://app.feixiangkeji.net',
        // baseUrl: "https://app.youtuyiliao.com",
        // imageUrl: "https://app.youtuyiliao.com",
        patientId: "", //患者id
        messageList: [], // 聊天记录列表
        startLoaded: false, // 启动页是否加载完毕
        pageInfo: {},
    },

    mutations: {
        setPageInfo(state, pageInfo) {
            state.pageInfo = pageInfo || {};
        },
        setMessageList(state, messageList) {
            state.messageList = messageList || [];
        },
        setStartLoaded(state, startLoaded) {
            state.startLoaded = !!startLoaded;
        },
    },
    getters: {
        startLoaded: (state) => state.startLoaded,
        pageInfo: (state) => state.pageInfo,
    },
    actions: {
        async resetStore() {
            console.log('调用重置store方法');

            // 清除全部缓存
            // uni.clearStorageSync();
            // 清空所有请求
            clearRequestTask();
            // 即时通讯退出登录
            // await uni.$im.logout();
        },
    },
}

export default chronic
